package com.code.family.entity.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import com.code.family.entity.enums.AccountType;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

/**
 * 账户信息
 */
@TableName(value ="accounts")
@Data
public class Accounts implements Serializable {
    /**
     * 主键，自增
     */
    @TableId(type = IdType.AUTO)
    private Integer id;
    /**
     * 用户ID
     */
    @TableField(value = "user_id")
    private Integer userId;
    /**
     * 账户类型: 银行/信用卡/微信/支付宝
     */
    private AccountType type;
    /**
     * 账户名称
     */
    private String accountName;
    /**
     * 账户号码
     */
    private String accountNumber;

    /**
     * 余额
     */
    private Float balance;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    private Date createdAt;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    private Date updatedAt;

    @Serial
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}